#!/bin/bash
#
# openQRM Enterprise developed by openQRM Enterprise GmbH.
#
# All source code and content (c) Copyright 2014, openQRM Enterprise GmbH unless specifically noted otherwise.
#
# This source code is released under the GNU General Public License version 2, unless otherwise agreed with openQRM Enterprise GmbH.
# The latest version of this license can be found here: src/doc/LICENSE.txt
#
# By using this software, you acknowledge having read this license and agree to be bound thereby.
#
#           http://openqrm-enterprise.com
#
# Copyright 2014, openQRM Enterprise GmbH <info@openqrm-enterprise.com>
#

export `eval cat /proc/cmdline`	2>/dev/null
. /var/openqrm/openqrm-resource.conf
export OPENQRM_SERVER_BASE_DIR=$resource_basedir
. $resource_basedir/openqrm/include/openqrm-functions

# do not start on the intitrd
if [ -f /etc/initrd-devices.conf ]; then
	exit 0
fi

function nagios3_start() {
	echo "Starting the openQRM nagios3-plugin"
	nagios3_stop 1>/dev/null 2>&1
	return 0
}


function nagios3_stop() {
	echo "Stopping the openQRM nagios3 plugin"
	return 0
}



case "$1" in
	start)
		nagios3_start
		;;
	stop)
		nagios3_stop
		;;
	restart)
		nagios3_stop
		sleep 1
		nagios3_start
		;;
	*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1

esac
exit $?

